package com.damai.redis;

import org.springframework.data.redis.connection.DataType;
import org.springframework.data.redis.core.Cursor;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ScanOptions;
import org.springframework.data.redis.core.ZSetOperations;

import java.lang.reflect.Type;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;


public interface RedisCache {

    
    <T> T get(RedisKeyBuild redisKeyBuild, Class<T> clazz);
    
    
    <T> T get(RedisKeyBuild redisKeyBuild, Class<T> clazz, Supplier<T> supplier, long ttl, TimeUnit timeUnit);

    
    String getRange(RedisKeyBuild redisKeyBuild, long start, long end);

    
    <T> List<T> getValueIsList(RedisKeyBuild redisKeyBuild, Class<T> clazz);
    
    
    <T> List<T> getValueIsList(RedisKeyBuild redisKeyBuild, Class<T> clazz, Supplier<List<T>> supplier, long ttl, TimeUnit timeUnit);


    
    List<String> getKeys(List<RedisKeyBuild> keyList);

    
    Boolean hasKey(RedisKeyBuild redisKeyBuild);

    
    void del(RedisKeyBuild redisKeyBuild);


    
    void del(Collection<RedisKeyBuild> keys);

    
    Boolean expire(RedisKeyBuild redisKeyBuild, long ttl, TimeUnit timeUnit);

    
    Long getExpire(RedisKeyBuild redisKeyBuild);
    
    
    Long getExpire(RedisKeyBuild redisKeyBuild,TimeUnit timeUnit);

    
    Set<String> keys(String pattern);

    
    Boolean move(RedisKeyBuild redisKeyBuild, int dbIndex);

    
    Boolean persist(RedisKeyBuild redisKeyBuild);

    
    String randomKey();

    
    void rename(RedisKeyBuild oldKey, RedisKeyBuild newKey);

    
    Boolean renameIfAbsent(RedisKeyBuild oldKey, RedisKeyBuild newKey);

    
    DataType type(RedisKeyBuild redisKeyBuild);

    
    void set(RedisKeyBuild redisKeyBuild, Object object);

    
    void set(RedisKeyBuild redisKeyBuild, Object object, long ttl);

    
    void set(RedisKeyBuild redisKeyBuild, Object object, long ttl, TimeUnit timeUnit);

    
    boolean setIfAbsent(RedisKeyBuild redisKeyBuild, Object object);

    
    Long size(RedisKeyBuild redisKeyBuild);

    
    void multiSet(Map<RedisKeyBuild, ?> map);

    
    boolean multiSetIfAbsent(Map<RedisKeyBuild, ?> map);

    
    Long incrBy(RedisKeyBuild redisKeyBuild, long increment);

    
    Double incrByDouble(RedisKeyBuild redisKeyBuild, double increment);

    
    Integer append(RedisKeyBuild redisKeyBuild, String value);

    

    
    void putHash(RedisKeyBuild redisKeyBuild, String hashKey, Object value);

    
    void putHash(RedisKeyBuild redisKeyBuild, String hashKey, Object value, long ttl);

    
    void putHash(RedisKeyBuild redisKeyBuild, String hashKey, Object value, long ttl, TimeUnit timeUnit);

    
    void putHash(RedisKeyBuild redisKeyBuild, Map<String, ?> map);

    
    void putHash(RedisKeyBuild redisKeyBuild, Map<String, ?> map, long ttl);

    
    void putHash(RedisKeyBuild redisKeyBuild, Map<String, ?> map, long ttl, TimeUnit timeUnit);

    
    Boolean putHashIfAbsent(RedisKeyBuild redisKeyBuild, String hashKey, Object value);

    
    @SuppressWarnings("all")
    <T> T getForHash(RedisKeyBuild redisKeyBuild, String hashKey, Class<T> clazz);

    
    <T> List<T> getValueIsListForHash(RedisKeyBuild redisKeyBuild, String hashKey, Class<T> clazz);

    
    <T> List<T> multiGetForHash(RedisKeyBuild redisKeyBuild, List<String> hashKeys, Class<T> clazz);

    
    <T> List<T> getAllForHash(RedisKeyBuild redisKeyBuild, Class<T> clazz);
    
    
    <T> Map<String,T> getAllMapForHash(RedisKeyBuild redisKeyBuild, Class<T> clazz);

    
    <T> Map<String,T> getAllMapForHash(String key, Class<T> clazz);
    
    
    Boolean hasKeyForHash(RedisKeyBuild redisKeyBuild, String hashKey);

    
    Long delForHash(RedisKeyBuild redisKeyBuild, String hashKey);

    
    Long delForHash(RedisKeyBuild redisKeyBuild, Collection<String> hashKeys);

    
    Long incrByForHash(RedisKeyBuild redisKeyBuild, String hashKey, long increment);

    
    Double incrByDoubleForHash(RedisKeyBuild redisKeyBuild, String hashKey, double delta);

    
    Set<String> hashKeysForHash(RedisKeyBuild redisKeyBuild);

    
    Long sizeForHash(RedisKeyBuild redisKeyBuild);

    

    
    <T> T indexForList(RedisKeyBuild redisKeyBuild, long index, Class<T> clazz);

    
    Long leftPushForList(RedisKeyBuild redisKeyBuild, Object value);

    
    Long leftPushAllForList(RedisKeyBuild redisKeyBuild, List<?> valueList);

    
    Long leftPushIfPresentForList(RedisKeyBuild redisKeyBuild, Object value);

    
    Long leftPushForList(RedisKeyBuild redisKeyBuild, Object pivot, Object value);

    
    Long rightPushForList(RedisKeyBuild redisKeyBuild, Object value);

    
    Long rightPushAllForList(RedisKeyBuild redisKeyBuild, List<Object> valueList);

    
    Long rightPushIfPresentForList(RedisKeyBuild redisKeyBuild, Object value);

    
    Long rightPushForList(RedisKeyBuild redisKeyBuild, Object pivot, Object value);

    
    void setForList(RedisKeyBuild redisKeyBuild, long index, Object value);

    
    <T> T leftPopForList(RedisKeyBuild redisKeyBuild, Class<T> clazz);

    
    <T> T leftPopBlockForList(RedisKeyBuild redisKeyBuild, Class<T> clazz, long timeout, TimeUnit unit);

    
    <T> T rightPopForList(RedisKeyBuild redisKeyBuild, Class<T> clazz);

    
    <T> T rightPopBlockForList(RedisKeyBuild redisKeyBuild, Class<T> clazz, long timeout, TimeUnit unit);

    
    <T> T rightPopAndLeftPushForList(RedisKeyBuild sourceKey, RedisKeyBuild destinationKey, Class<T> clazz);

    
    <T> T rightPopBlockAndLeftPushForList(RedisKeyBuild sourceKey, RedisKeyBuild destinationKey, Class<T> clazz, long timeout, TimeUnit unit);

    
    <T> List<T> getAllForList(RedisKeyBuild redisKeyBuild, Class<T> clazz);

    
    <T> List<T> rangeForList(RedisKeyBuild redisKeyBuild, long start, long end, Class<T> clazz);


    
    Long removeForList(RedisKeyBuild redisKeyBuild, long index, Object value);


    
    void trimForList(RedisKeyBuild redisKeyBuild, long start, long end);

    
    Long lenForList(RedisKeyBuild redisKeyBuild);


    

    
    Long addForSet(RedisKeyBuild redisKeyBuild, Object value);

    
    Long addForSet(RedisKeyBuild redisKeyBuild, List<?> values);

    
    Long removeForSet(RedisKeyBuild redisKeyBuild, Object value);

    
    Long removeForSet(RedisKeyBuild redisKeyBuild, List<?> values);

    
    <T> T popForSet(RedisKeyBuild redisKeyBuild, Class<T> clazz);

    
    boolean moveForSet(RedisKeyBuild redisKeyBuild, Object value, RedisKeyBuild destRedisKeyBuild);

    
    Long sizeForSet(RedisKeyBuild redisKeyBuild);

    
    Boolean isMemberForSet(RedisKeyBuild redisKeyBuild, Object value);

    
    <T> Set<T> intersectForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, Class<T> clazz);

    
    <T> Set<T> intersectForSet(RedisKeyBuild redisKeyBuild, Collection<RedisKeyBuild> otherRedisKeyBuilds, Class<T> clazz);

    
    Long intersectAndStoreForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild);

    
    Long intersectAndStoreForSet(RedisKeyBuild redisKeyBuild, Collection<RedisKeyBuild> otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild);

    
    <T> Set<T> unionForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, Class<T> clazz);

    
    <T> Set<T> unionForSet(RedisKeyBuild redisKeyBuild, Collection<RedisKeyBuild> otherRedisKeyBuilds, Class<T> clazz);

    
    Long unionAndStoreForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild);

    
    Long unionAndStoreForSet(RedisKeyBuild redisKeyBuild, Collection<RedisKeyBuild> otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild);

    
    <T> Set<T> differenceForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, Class<T> clazz);

    
    <T> Set<T> differenceForSet(RedisKeyBuild redisKeyBuild, Collection<RedisKeyBuild> otherRedisKeyBuilds, Class<T> clazz);

    
    Long differenceForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild);

    
    Long differenceForSet(RedisKeyBuild redisKeyBuild, Collection<RedisKeyBuild> otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild);

    
    <T> Set<T> membersForSet(RedisKeyBuild redisKeyBuild, Class<T> clazz);

    
    <T> T randomMemberForSet(RedisKeyBuild redisKeyBuild, Class<T> clazz);

    
    <T> List<T> randomMembersForSet(RedisKeyBuild redisKeyBuild, long count, Class<T> clazz);

    
    <T> Set<T> distinctRandomMembersForSet(RedisKeyBuild redisKeyBuild, long count, Class<T> clazz);

    
    Cursor<String> scanForSet(RedisKeyBuild redisKeyBuild, ScanOptions options);



    

    
    void addForSortedSet(RedisKeyBuild redisKeyBuild, Object value, Double score);

    
    void addForSortedSet(RedisKeyBuild redisKeyBuild, Object value, Double score, long ttl);

    
    void addForSortedSet(RedisKeyBuild redisKeyBuild, Object value, Double score, long ttl, TimeUnit timeUnit);

    
    Long addForSortedSet(RedisKeyBuild redisKeyBuild, Map<?, Double> map);

    
    Long addForSortedSet(RedisKeyBuild redisKeyBuild, Map<?, Double> map, long ttl);

    
    Long addForSortedSet(RedisKeyBuild redisKeyBuild, Map<?, Double> map, long ttl, TimeUnit timeUnit);

    
    <T> Set<T> getRangeForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end, Class<T> clazz);

    
    <T> Set<T> getReverseRangeForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end, Class<T> clazz);

    
    Long delForSortedSet(RedisKeyBuild redisKeyBuild, Object value);

    
    Long delForSortedSet(RedisKeyBuild redisKeyBuild, Collection<?> valueCollection);

    
    Long delRangeForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end);


    
    Double incrementScoreForSortedSet(RedisKeyBuild redisKeyBuild, Object value, double delta);



    
    Long sizeForSortedSet(RedisKeyBuild redisKeyBuild);

    
    Long rankForSortedSet(RedisKeyBuild redisKeyBuild, Object value);

    
    Long reverseRankForSortedSet(RedisKeyBuild redisKeyBuild, Object value);


    
    <T> Set<ZSetOperations.TypedTuple<T>> rangeWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end, Class<T> clazz);


    
    <T> Set<T> rangeByScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, Class<T> clazz);

    
    <T> Set<ZSetOperations.TypedTuple<T>> rangeByScoreWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, Class<T> clazz);


    
    <T> Set<ZSetOperations.TypedTuple<T>> rangeByScoreWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max,
                                                                            long start, long end, Class<T> clazz);

    
    <T> Set<ZSetOperations.TypedTuple<T>> reverseRangeWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end, Class<T> clazz);

    
    <T> Set<T> reverseRangeByScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, Class<T> clazz);

    
    <T> Set<ZSetOperations.TypedTuple<T>> reverseRangeByScoreWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, Class<T> clazz);

    
    <T> Set<T> reverseRangeByScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, long start, long end, Class<T> clazz);

    
    Long countForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max);

    
    Long zCardForSortedSet(RedisKeyBuild redisKeyBuild);

    
    Double scoreByValueForSortedSet(RedisKeyBuild redisKeyBuild, Object value);

    
    Long removeRangeForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end);

    
    Long removeRangeByScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max);

    
    Long unionAndStoreForSortedSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild);

    
    Long unionAndStoreForSortedSet(RedisKeyBuild redisKeyBuild, Collection<RedisKeyBuild> otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild);

    
    Long intersectAndStoreForSortedSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild);

    
    Long intersectAndStoreForSortedSet(RedisKeyBuild redisKeyBuild, Collection<RedisKeyBuild> otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild);

    
    Cursor<ZSetOperations.TypedTuple<String>> scanForSortedSet(RedisKeyBuild redisKeyBuild, ScanOptions options);

    
    <T> T getByType(RedisKeyBuild redisKeyBuild, Type genericReturnType);
    
    RedisTemplate getInstance();
}
